package com.yigang.controller;

import java.text.ParseException;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;



import com.yigang.entity.UpdateParameter;
import com.yigang.service.UpdateParameterService;
import com.yigang.utils.ResultUtil;

@Controller
@RequestMapping("/updateParameter")
public class UpdateParameterController {

	@Autowired
	private UpdateParameterService updateParameterService;
	
	@RequestMapping("editParameter/{product_id}")
	public String editParameter(@PathVariable("product_id") Integer product_id, HttpSession session) {
		UpdateParameter updateParameter = updateParameterService.selectProductById(product_id);
	
		session.setAttribute("updateParameter", updateParameter);
		return "jsp/product/editParameter";
	}
	@RequestMapping("updateParameter1")
	@ResponseBody
	public ResultUtil updateParameter1(UpdateParameter record) throws ParseException {
		
		return updateParameterService.updateByPrimaryKeySelective(record);
	}
}
